﻿#ifndef USERADDDLG_H
#define USERADDDLG_H

#include <QWidget>
#include <QJsonObject>
#include <QBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QRadioButton>
#include <QButtonGroup>
#include "SSwitchButton.h"
#include <QFormLayout>
#include "eventfilterobject.h"
#include "SHttpClient.h"
#include "SApp.h"
#include <QMessageBox>




class UserAddDlg : public QWidget
{
	Q_OBJECT
private:
	QJsonObject m_user;

	QVBoxLayout* m_totality_layout{};
	QFormLayout* m_password_layout{};

	QPushButton* m_closeBtn{};

	QLineEdit* m_user_id_edit{};
	QLineEdit* m_username_edit{};
	QButtonGroup* m_group_gender{};							//性别组
	QRadioButton* m_gender_boy{};							//男
	QRadioButton* m_gender_secret{};						//保密
	QRadioButton* m_gender_gril{};							//女 
	QLineEdit* m_mobile_edit{};
	QLineEdit* m_email_edit{};
	QButtonGroup* m_group_password{};						//密码组
	QRadioButton* m_default_password_rbtn{};				//默认密码
	QRadioButton* m_custom_password_rbtn{};					//自定义密码
	QLineEdit* m_password_edit{};
	QPushButton* m_ok_btn{};
	QPushButton* m_cancel_btn{};


signals:
	void userDataChanged(const QJsonObject& object);
	void endShow();
public:
	UserAddDlg(QWidget* parent = nullptr);
	~UserAddDlg();

	void init();
	void setUserData(const QJsonObject& object);

	void initset();
	void connectinit();

};

#endif // !USERADDDLG_H
